package lifeOfAFish.scenegraph;

/**
 * Class for representing a camera in the scenegraph.
 * @author Erik Bonner
 */
public class sgCamera {

	sgVec3 m_eye = new sgVec3(0.0f, 0.0f, 0.0f);;
	sgVec3 m_at = new sgVec3(0.0f, 0.0f, -1.0f);;
	sgVec3 m_up = new sgVec3(0.0f, 1.0f, 0.0f);;
	
	/**
	 * Constructor
	 */
	public sgCamera()
	{
	}
	
//	/**
//	 * Activate the current camera. 
//	 * From now on, scene will be projected to this camera. 
//	 */
//	public void activate()
//	{
//		m_active = true;
//	}
//	
//	/**
//	 * Deactivate current camera
//	 * It is expected that another camera object will now be activated
//	 */
//	public void deactivate()
//	{
//		m_active = false;
//	}
//	
//	/**
//	 * Check if camera is active
//	 */
//	public boolean isActive()
//	{
//		return m_active;
//	}
	
	/**
	 * Render method.
	 */
	public void apply() {
			sgGlobals.glu.gluLookAt(m_eye.getX(), m_eye.getY(), m_eye.getZ(),
									m_at.getX(), m_at.getY(), m_at.getZ(), 
									m_up.getX(), m_up.getY(), m_up.getZ());
	}
	
	public void lookAt(sgVec3 at, sgVec3 eye, sgVec3 up)
	{
		m_eye = eye;
		m_at = at;
		m_up = up;
	}
	
	public String toString()
	{
		String str = "at " + m_at + "\n" + 
		"eye " + m_eye + "\n" + 
		"up " + m_up;
		return str;
	}
	

}
